using System;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.Events;

namespace Survivor
{
    public class CoinUpgradeItem
    {
        public string Key { get; set; }
        public string Description { get; set; }

        public int Price
        {
            get
            {
                if (GetPriceByLevel != null)
                {
                    return GetPriceByLevel(Level);
                }

                return 0;
            }
        }
        public int Level { get; set; }
        public int MaxLevel { get; set; }

        public UnityAction<CoinUpgradeItem> OnUpgrade = null;
        public Func<int,int> GetPriceByLevel;

        public void Upgrade()
        {
            Level += 1;
            Debug.Log(Level);
            OnUpgrade?.Invoke(this);
        }


    }
}

